<template>
  <a-card :bordered="false">


    <div class="table-operator">
      <a-button type="primary" icon="plus" @click="$refs.save.add()">新建</a-button>
    </div>

    <a-table
      :rowKey=" (record => record.id)"
      :dataSource="tableData"
      :loading="loading"
    >
      <a-table-column title="角色" dataIndex="roleName" key="roleName"/>
      <a-table-column title="创建时间" dataIndex="createdTime" key="createdTime"/>
      <a-table-column title="操作">
        <template slot-scope="record">
        <span>
          <a href="javascript:;" @click="$refs.authority.edit(record)">权限</a>
          <a-divider type="vertical"/>
          <a href="javascript:;" @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
            <a-popconfirm title="确定删除吗？" @confirm="handleDelete(record)">
                 <a-icon slot="icon" type="question-circle-o" style="color: red"/>
                <a href="javascript:;">删除</a>
             </a-popconfirm>
        </span>
        </template>
      </a-table-column>
    </a-table>

    <save ref="save" @refresh="refresh"></save>
    <authority ref="authority" ></authority>
  </a-card>
</template>


<script>
  import save from './save/save'
  import listMixins from '../../../common/mixins/listMixins'
  import { selectAll,deleteById } from '../../../api/base/role'
  import authority from './authority/authority'
  export default {
    name: 'role',
    mixins: [listMixins],
    components: {
      save,
      authority
    },
    data(){
      return{
      }
    },
    methods: {
      getList(param) {
        return selectAll(param)
      },
      delete(param){
        return deleteById(param)
      },

    }
  }
</script>

<style scoped>

</style>